package utils.rsshub;

import entity.ConfigFile;
import lombok.Getter;
import utils.json.InitConfig;

/**
 * RSSHub配置类
 * UID B站uid
 * BaseURL RSSHub服务基础地址
 * CoinURL 获取投币视频地址
 * FavURL 获取收藏视频地址
 */
@Getter
public class RSSHubConfig {
    private final String UID;
    private final String BaseURL;
    private final String CoinURL;
    private final String FavURL;
    private static final RSSHubConfig instance = new RSSHubConfig();
    ConfigFile config = InitConfig.getInstance().getConfig();

    private RSSHubConfig() {
        this.UID = config.getRSSHub().getUid();
        this.BaseURL = config.getRSSHub().getBaseURL();
        this.CoinURL = this.BaseURL + "coin/" + UID;
        this.FavURL = this.BaseURL + "fav/" + UID;
    }

    public static RSSHubConfig getInstance() {
        return instance;
    }
}
